package com.example.spring.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.*;

/**
 * @功能
 * @作者 沈飞超
 * @日期 2020年09月04日 5:46
 */
@Aspect
public class MyAspect {

    @Pointcut("execution(* com.example.spring.aspect.Bus.*(..))")
    public void pointCut() {
    }

    @Before(value = "pointCut()")
    public void logStart(JoinPoint joinPoint) {
        System.out.println("logStart...");
    }

    @After(value = "pointCut()")
    public void logEnd() {
        System.out.println("logEnd...");
    }

    @AfterReturning(value = "pointCut()")
    public void logReturning() {
        System.out.println("logReturning...");
    }

    @AfterThrowing(value = "pointCut()")
    public void logThrowing() {
        System.out.println("logThrowing...");
    }

}
